<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="vue.js" type="text/javascript"></script>
    <script src="vue-resource.js" type="text/javascript"></script>
</head>
<body>

<div id="box">
    <input type="button" value="确认" @click="get">
</div>

<script>
        new Vue({
            el:'#box',
            data:{

            },
            methods:{
                get:function(){
                   this.$http({
                       url:'add.php',
                       data:{a:1,b:2},

                   }).then(function(res){
                       alert(res.data);
                   })
                }
            }
        });
</script>
</body>
</html>